﻿package baidu.reader.common
{
    import flash.events.*;
    import flash.external.*;

    public class JSManager extends EventDispatcher
    {

        public function JSManager(param1:IEventDispatcher = null)
        {
            super(param1);
            this.addCallBackToJs();
            return;
        }// end function

        private function addCallBackToJs() : void
        {
            if (ExternalInterface.available)
            {
                ExternalInterface.addCallback("NS_IK_doMouseWheel", this.doMouseWheelHandler);
            }
            return;
        }// end function

        private function doMouseWheelHandler(param1:Number) : void
        {
            dispatchEvent(new ReaderEvent(ReaderEvent.HTML_MOUSE_WHEEL, -param1));
            return;
        }// end function

    }
}
